package com.xing.book.test;

import java.sql.Connection;
import java.sql.SQLException;

public class testMyPool {
    public static void main(String[] args) throws SQLException {
        MyDbPool myDbPool = new MyDbPool();
        for (int i = 0; i < 100; i++) {
            Connection connection =  myDbPool.getConnection();
            if(connection!=null){
                System.out.println(i+"获取了"+connection.hashCode());
                myDbPool.release(connection);
            }else {
                System.out.println(i+"没有取到连接");
            }

        }
    }
}
